package br.com.schs.sessionbeans;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import br.com.schs.entity.PerguntaSecreta;

@Stateless
public class PerguntaSecretaSessionBean {

	@PersistenceContext
	private EntityManager entityManager;
	
	@SuppressWarnings("unchecked")
	public List<PerguntaSecreta> consultarTodasPerguntasSecretas(){
		Query query = entityManager.createNamedQuery("PerguntaSecreta.consultarTodasPerguntasSecretas");
		try {
			return query.getResultList();
		} catch (NoResultException e) {
			return null;
		}
	}
	
	
}
